package com.srzk.youthleagueback.service;

import com.srzk.youthleagueback.mapper.NoteMapper;
import com.srzk.youthleagueback.pojo.Note;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NoteService {

    @Autowired
    private NoteMapper noteMapper;

    public boolean updateNote(Note note) {
        int result = noteMapper.updateByPrimaryKey(note);
        return result == 1;
    }

    public boolean addNote(Note note) {
        int result = noteMapper.insert(note);
        return result == 1;
    }

    public Note searchNoteByUserAndYear(String user,String year) {
        Note note1 = noteMapper.selectByPrimaryKey(user,year);
        return note1;
    }
}
